﻿using System.Windows;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Prism.UnityExtensions;

namespace DeskTop
{
    class Bootstrapper : UnityBootstrapper
    {
        protected override DependencyObject CreateShell()
        {
            return this.Container.Resolve<MainWindow>();
        }

        protected override void InitializeShell()
        {
            base.InitializeShell();

            App.Current.MainWindow = (Window)this.Shell;
            App.Current.MainWindow.Show();
        }

        protected override void ConfigureModuleCatalog()
        {
            base.ConfigureModuleCatalog();

            ModuleCatalog moduleCatalog = (ModuleCatalog)this.ModuleCatalog;
            moduleCatalog.AddModule(typeof(ModA.ModA));
            moduleCatalog.AddModule(typeof(ModB.ModB));
            moduleCatalog.AddModule(typeof(ModC.ModC));
            moduleCatalog.AddModule(typeof(ModD.ModD));
            moduleCatalog.AddModule(typeof(ModE.ModE));
            moduleCatalog.AddModule(typeof(ModF.ModF));
            moduleCatalog.AddModule(typeof(ModG.ModG));
            moduleCatalog.AddModule(typeof(ModH.ModH));
        }
    }
}
